package com.example.feign;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("feign")
public class FeignController {

    @Autowired
    private FeignConsumeService feignConsumeService;
    @Autowired
    private HttpConsumeService httpConsumeService;

    @RequestMapping("index")
    public String index(){
        System.out.println("from feign consume");
        return feignConsumeService.index();
    }

    @RequestMapping("/test")
    public String test(){
        return "test";
    }

    @RequestMapping("/httpTest")
    public String httpTest(){
        System.out.println("httpTest begin");
        return httpConsumeService.httpTest("1","301");
    }
}
